import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

class XIcon extends StatelessWidget {
  IconData? icon;
  Color iconColor;
  Color bgColor;
  double size;

  XIcon(
      {Key? key,
      this.icon,
      this.iconColor = Colors.white,
      this.size = 32,
      this.bgColor = Colors.blue})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 100,
      height: 100,
      color: bgColor,
      child: Center(
          child: Icon(
        icon,
        color: iconColor,
        size: size,
      )),
    );
  }
}

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text("Icon List"),
      ),
      //bottom center!!!
      body: Column(
        mainAxisAlignment: MainAxisAlignment.end,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            // crossAxisAlignment: CrossAxisAlignment.end,
            children: [
              XIcon(icon: Icons.home),
              XIcon(icon: Icons.category),
              XIcon(icon: Icons.settings),
            ],
          ),
        ],
      ),
    ),
  ));
}
